﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace Axial.Tests
{
	[TestFixture]
	public class MixedBranchTests : TestBase
	{
		[Test]
		public void IfInWhileTest()
		{
			string check =
@"while (a > 1)
{
	if (b == 2)
		b = 3;
	else
		b = 4;
	a = a - 1;
}";
			check = VerifyMethodOutput("IfInWhile", check);
		}

		public void IfInWhile()
		{
			int a = 3;
			int b = 2;
			while (a > 1)
			{
				if (b == 2)
					b = 3;
				else
					b = 4;
				a--;
			}
		}

		[Test]
		public void WhileInIfTest()
		{
			string check =
@"if (a > 1)
	while (b >= 2)
		b = 1;";
			check = VerifyMethodOutput("WhileInIf", check);
		}

		public void WhileInIf()
		{
			int a = 1;
			int b = 2;
			if (a > 1)
				while (b >= 2)
					b = 1;
		}
	}
}
